export const routes = [
  {
    path: '/',
    redirect: '/home',
    component: () => import('@/layout/basic/index.vue'),
    children: [
      {
        path: 'home',
        component: () => import('@/pages/home/index.vue'),
        meta: {
          title: 'tabbar.home',
          keepAlive: true,
        },
      },
      {
        path: 'list',
        component: () => import('@/pages/list/index.vue'),
        meta: {
          title: 'tabbar.list',
          keepAlive: true,
        },
      },
      {
        path: 'add',
        component: () => import('@/pages/add/index.vue'),
        meta: {
          title: 'tabbar.add',
          keepAlive: true,
        },
      },
      {
        path: '/addTravelPlan',
        component: () => import('@/pages/add/addTravelPlan/index.vue'),
        meta: {
          title: 'add.addTravelPlan',
          keepAlive: true,
        },
      },
      {
        path: '/editTravelPlan',
        component: () => import('@/pages/add/editTravelPlan/index.vue'),
        meta: {
          title: 'add.editTravelPlan',
          keepAlive: true,
        },
      },
      {
        path: '/travelPlanDetail',
        component: () => import('@/pages/add/travelPlanDetail/index.vue'),
        meta: {
          title: 'add.travelPlanDetail',
          keepAlive: true,
        },
      },
      {
        path: 'member',
        component: () => import('@/pages/member/index.vue'),
        meta: {
          title: 'tabbar.member',
          keepAlive: true,
        },
      },
      {
        name: 'personalData',
        path: '/personalData',
        component: () => import('@/pages/member/personalData/index.vue'),
        meta: {
          title: 'member.personalData',
          border: false,
        },
      },
      {
        name: 'like',
        path: '/like',
        component: () => import('@/pages/member/like/index.vue'),
        meta: {
          title: 'member.like',
          border: false,
        },
      },
      {
        name: 'collection',
        path: '/collection',
        component: () => import('@/pages/member/collection/index.vue'),
        meta: {
          title: 'member.collection',
          border: false,
        },
      },
      {
        name: 'works',
        path: '/works',
        component: () => import('@/pages/member/works/index.vue'),
        meta: {
          title: 'member.works',
          border: false,
        },
      },
      {
        path: 'demo',
        component: () => import('@/pages/demo/index.vue'),
        meta: {
          title: 'tabbar.demo',
          keepAlive: true,
        },
      },
      {
        name: 'listDetails',
        path: '/details',
        component: () => import('@/pages/list/details/index.vue'),
        meta: {
          title: 'list.details',
          border: false,
        },
      },
      {
        name: 'rustic',
        path: '/rustic',
        component: () => import('@/pages/rustic/index.vue'),
        meta: {
          title: 'tabbar.rustic',
          border: false,
        },
      },
      {
        name: 'rusticDetailList',
        path: '/detailList',
        component: () => import('@/pages/rustic/detailList.vue'),
        meta: {
          title: 'rustic.detailList',
          border: false,
        },
      },
      {
        name: 'attractions',
        path: '/attractions',
        component: () => import('@/pages/attractions/index.vue'),
        meta: {
          title: 'tabbar.attractions',
          border: false,
        },
      },
      {
        name: 'food',
        path: '/food',
        component: () => import('@/pages/food/index.vue'),
        meta: {
          title: 'tabbar.food',
          border: false,
        },
      },
      {
        name: 'eventActivity',
        path: '/eventActivity',
        component: () => import('@/pages/eventActivity/index.vue'),
        meta: {
          title: 'tabbar.eventActivity',
          border: false,
        },
      },
    ],
  },
  {
    name: 'login',
    path: '/login',
    component: () => import('@/pages/login/index.vue'),
    meta: {
      title: '',
      keepAlive: true,
    },
  },
  {
    name: 'register',
    path: '/register',
    component: () => import('@/pages/login/register.vue'),
    meta: {
      title: '',
      keepAlive: true,
    },
  },
  // 匹配不到重定向会主页
  {
    // 找不到路由重定向到404页面
    path: '/:pathMatch(.*)',
    redirect: '/Home',
  },
];

export default routes;
